﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class MyTest<T>
    {

        private T[] Ts = new T[3];
        private int index = 0;
        public void Add(T t)
        {
            //添加项
            if (index < 3)
            {
                Ts[index] = t;
                index++;
            }
            else
            {
                Console.WriteLine("受不了了");
            }
        }
        public void Show()
        {
            foreach (T t in Ts)
            {
                Console.WriteLine(t);
            }

        }
    }
}
